package main.java.person.fjsp.common.entity;

import java.util.Objects;

public class Operation {
    /**
     * 所属作业的编号
     */
    private int jobNumber;
    /**
     * 工序在作业中的顺序
     */
    private int order;
    /**
     * 工序的完整编号（作业编号-在作业中的顺序）
     */
    private String code;
    /**
     * 工序的开始时间
     */
    private int releaseTime;
    /**
     * 工序的完工时间
     */
    private int completeTime;
    /**
     * 工序的处理时间
     */
    private int processTime;

    /**
     * 该工序选择的机器
     */
    private int machineNum;



    public Operation(int jobNumber, int order, String code, int releaseTime, int completeTime,int machineNum,int processTime) {
        this.jobNumber = jobNumber;
        this.order = order;
        this.code = code;
        this.releaseTime = releaseTime;
        this.completeTime = completeTime;
        this.machineNum=machineNum;
        this.processTime=processTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Operation operation = (Operation) o;
        return Objects.equals(code, operation.code);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code);
    }

    public int getJobNumber() {
        return jobNumber;
    }

    public void setJobNumber(int jobNumber) {
        this.jobNumber = jobNumber;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(int releaseTime) {
        this.releaseTime = releaseTime;
    }

    public int getCompleteTime() {
        return completeTime;
    }

    public void setCompleteTime(int completeTime) {
        this.completeTime = completeTime;
    }

    public int getMachineNum() {
        return machineNum;
    }

    public int getProcessTime() {
        return processTime;
    }

    public void setProcessTime(int processTime) {
        this.processTime = processTime;
    }

    public void setMachineNum(int machineNum) {
        this.machineNum = machineNum;
    }

    @Override
    public String toString() {
        return "{"+code +
                ", r=" + releaseTime +
                ", c=" + completeTime +
                ", p=" + processTime +
                '}';
    }
}
